package site.teamo.biu.flink.web.controller.model.functionpackage;

import cn.hutool.core.bean.BeanUtil;
import lombok.Data;
import lombok.experimental.Accessors;
import site.teamo.biu.flink.web.entity.OperatorPackageDO;

import java.util.Map;

/**
 * @author haocongshun
 * @date 2023/11/01 15:41:38
 */
@Data
@Accessors(chain = true)
public class UploadFunctionPackageResponse {
    private Map<String, String> message;
    private FunctionPackageInfo info;


    public UploadFunctionPackageResponse setInfo(OperatorPackageDO functionPackageDO) {
        this.info = new FunctionPackageInfo();
        BeanUtil.copyProperties(functionPackageDO, info);
        return this;
    }

    @Data
    @Accessors(chain = true)
    public static class FunctionPackageInfo {
        private String name;
        private String tag;
        private String md5;
        private Integer functionNumber;
    }
}
